import { Checkbox, Select } from 'antd';
import React from 'react'

const plainOptions = ['Apple', 'Pear', 'Orange'];

const App = () => {
  const [checkedList, setCheckedList] = React.useState(['Apple', 'Orange']);
  const [checkAll, setCheckAll] = React.useState(false);

  const onChange = list => {
    setCheckedList(list);
    setCheckAll(list.length === plainOptions.length);
  };

  const onCheckAllChange = e => {
    setCheckedList(e.target.checked ? plainOptions : []);
    setCheckAll(e.target.checked);
  };

  return (
    <>
      <Checkbox  onChange={onCheckAllChange} checked={checkAll}>
        Check all ||||||||||||
      </Checkbox>
    
      <Checkbox.Group options={plainOptions} value={checkedList} onChange={onChange} />
    </>
  );
};
export default App